package com.ossjk.oa.system.service.impl;

import com.ossjk.oa.system.entity.Token;
import com.ossjk.oa.system.mapper.TokenMapper;
import com.ossjk.oa.system.service.ITokenService;
import com.baomidou.mybatisplus.mapper.Condition;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author chair
 * @since 2019-01-28
 */
@Service
public class TokenServiceImpl extends ServiceImpl<TokenMapper, Token> implements ITokenService {

	@Override
	public boolean insertNewToken(Token token) {
		// 刪除原有token
		
		//Wrapper wrapper = Condition.create().eq("uid", token.getUid());
		//this.delete(wrapper);
		
		// 新增token
		return this.insert(token);
	}

}
